using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;

namespace PcrExperimentProject
{
	public class ShowLabelTextInRowSelect : IUIElementCreationFilter
	{
		public void AfterCreateChildElements(UIElement parent)
		{
			UIElement uIElement = parent.GetAncestor(typeof(RowSelectorUIElement)) as RowSelectorUIElement;
			if (uIElement != null)
			{
				TextUIElement textUIElement = parent as TextUIElement;
				if (textUIElement != null)
				{
					UltraGridRow ultraGridRow = parent.GetContext(typeof(UltraGridRow)) as UltraGridRow;
					textUIElement.Text = ultraGridRow.Cells["StepName"].Text;
					textUIElement.TextHAlign = HAlign.Center;
					textUIElement.TextVAlign = VAlign.Middle;
				}
			}
		}

		public bool BeforeCreateChildElements(UIElement parent)
		{
			return false;
		}
	}
}
